package com.gitee.wsl.common.chart.sample.bar.legend

import com.gitee.wsl.common.chart.model.PlotDot

import com.gitee.wsl.common.chart.render.foreground.AbstractChartLegend
import com.gitee.wsl.common.chart.sample.XChart
import com.gitee.wsl.common.chart.sample.bar.model.BarData
import com.gitee.wsl.common.ui.draw.type.DotStyle

class BarLegend(mXChart: XChart) : AbstractChartLegend<BarData>(mXChart) {

    override fun convertArrayKey(dataSet: List<BarData>) {
        var key = ""
        for (cData in dataSet) {
            key = cData.key
            if (!isDrawKey(key)) continue
            if ("" === key) continue
            mLstKey.add(key)
            mLstColor.add(cData.color)
            val dot = PlotDot()
            dot.dotStyle = DotStyle.RECT
            mLstDotStyle.add(dot)
        }
    }


}